//===- bolt/Profile/ONNXRunner.h - -----------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// llvm-bolt model runner
//
//===----------------------------------------------------------------------===//

#ifndef BOLT_PROFILE_ONNXRUNNER_H
#define BOLT_PROFILE_ONNXRUNNER_H

#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include "onnxruntime_c_api.h"
#include "onnxruntime_cxx_api.h"

namespace boltONNXRunner {
class ONNXRunner {
public:
    static float runONNXModel(std::vector<std::string> input_string, std::vector<int64_t> input_int64, std::vector<float> input_float);

private:
    static Ort::Value getInputValueFloat(Ort::Session &session, 
                                  std::vector<float> &input,
                                  int inputIdx);

    static Ort::Value getInputValueString(Ort::AllocatorWithDefaultOptions allocator,
                                   Ort::Session &session, 
                                   std::vector<std::string> &input,
                                   int inputIdx);
    
    static Ort::Value getInputValueInt64(Ort::Session &session, 
                                  std::vector<int64_t> &input,
                                  int inputIdx);
};
} // namespace boltONNXRunner
#endif